@file:Suppress("DEPRECATION")

package com.example.presentshopping.ui.activity

import android.Manifest
import android.app.AlertDialog
import android.app.Dialog
import android.content.Intent
import android.content.pm.PackageManager
import android.graphics.*
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import android.os.Bundle
import android.os.Handler
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.util.Log
import android.view.Gravity
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.InputMethodManager
import android.widget.Button
import android.widget.EditText
import android.widget.ImageView
import androidx.core.app.ActivityCompat
import cn.bingoogolapple.qrcode.zxing.QRCodeEncoder
import com.cwj.imagesynthesis.ImageBean
import com.example.presentshopping.R
import com.example.presentshopping.config.base.BaseMvpActivity
import com.example.presentshopping.config.base.MyApplication.getContext
import com.example.presentshopping.config.bean.ComesQCasBean
import com.example.presentshopping.mvp.presenter.PublicPresenter
import com.example.presentshopping.net.http.HttpRequest
import com.example.presentshopping.net.http.HttpURL
import com.example.presentshopping.ui.custom.PayPwdEditText
import com.example.presentshopping.ui.fragment.frgmentdlog.RedEnvelopeDialog
import com.example.presentshopping.utils.ShareUtils
import com.example.presentshopping.utils.ToastUtil
import com.example.presentshopping.utils.tool.unit.DensityUtil
import com.permissionx.guolindev.PermissionX
import com.yun.utils.image.ImageUtils
import com.yun.utils.image.QRCodeUtil
import com.yun.utils.image.SizeUtils
import kotlinx.android.synthetic.main.activity_comes_q_cas.*
import org.json.JSONObject

class ComesQCasActivity : BaseMvpActivity() {
    var imgs = ArrayList<ImageBean>()
    var cones: ComesQCasBean? = null
    var redevedia : RedEnvelopeDialog?=null
    private var queryInfoPresenter: PublicPresenter? = null


    override val layoutId: Int
        get() = R.layout.activity_comes_q_cas

    override fun initView(savedInstanceState: Bundle?) {

        bcak_iv.setOnClickListener { finish() }
        redevedia =RedEnvelopeDialog(this)

        invite_tv.setOnClickListener {

         //   addSelectedDate()
            redevedia?.show(supportFragmentManager,"")

        }
        val bm1 = (resources.getDrawable(R.mipmap.fenx2) as BitmapDrawable).bitmap
        lian_rasie.setImageBitmap(bm1)


    }

    override fun showToast(msg: String?) {
        ToastUtil.showMsg(msg)
    }

    override fun onFailure(e: Throwable?, code: Int, msg: String?, isNetWorkError: Boolean) {
        showToast(msg)
    }

    override fun onSuccess(data: String?) {
    }

    override fun onDestroy() {

        super.onDestroy()
    }


    private var bitmap_1: Bitmap? = null


}